from email.policy import default

from tortoise import Model,fields

class User(Model):
    username = fields.CharField(null=True,max_length=20,description="用户名")
    type = fields.CharField(default=False,max_length=32,description="用户类型 True:超级管理员 False: 普通管理员")
    password = fields.CharField(null=True,max_length=255)
    nickname = fields.CharField(default='sgzeng',max_length=255,description='昵称')
    u_phone = fields.CharField(null=True,max_length=255,description='手机号')
    u_email = fields.CharField(null=True,max_length=255,description='油箱')
    full_name = fields.CharField(null=True,max_length=255,description='姓名')
    u_status = fields.CharField(default=0,max_length=32,null=True,description='0未激活 1正常 2禁用')
    head_img = fields.CharField(null=True,max_length=255,description='头像')
    sex = fields.CharField(default=1,null=True,max_length=255,description='0未知 1男 2女')
    remarks = fields.CharField(null=True,max_length=255,description='备注')
    client_host = fields.CharField(null=True,max_length=255,description='访问IP')
    create_time = fields.DatetimeField(auto_now_add=True,description='创建时间')
    update_time = fields.DatetimeField(auto_now=True,description='更新时间')

    class Meta:
        table = 'user'
        table_description = "用户"